CC = /opt/xtools/arm920t/bin/arm-linux-gcc
AR = /opt/xtools/arm920t/bin/arm-linux-ar



LDFLAGS+=-static 		\
		-lpthread 		\
		-lcomport 		\
		-lserver_socket \
		-lcrc-itu-t

CFLAGS+=-I`pwd`

COMPILE=module_main.c	\
		create_thread.c	\
		at_cmd.c 		\
		ppp.c 			\
		gsmd_tlv.c 		\
		gsmd.c


all:static_lib compile 
		@rm -r *.o *.a

static_lib:
		@${CC} comport.c ${CFLAGS} -c -o comport.o
		@${CC} server_socket.c ${CFLAGS} -c -o server_socket.o
		@${CC} crc-itu-t.c ${CFLAGS} -c -o crc-itu-t.o
		

		@${AR} -cr libcomport.a comport.o 
		@${AR} -cr libserver_socket.a server_socket.o 
		@${AR} -cr libcrc-itu-t.a crc-itu-t.o 
compile:
		@${CC} -Wall ${COMPILE} -o module_test -L`pwd` ${LDFLAGS}

clean:
		@rm -r module_test
